//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.mouslisten;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import org.come.Frame.ZhuFrame;
import org.come.Jpanel.DianJpanel;
import org.come.Jpanel.RefinersJpanel;
import org.come.Jpanel.RefiningEquiJpanel;
import org.come.Jpanel.RefiningEquiJpanel2;
import org.come.entity.Goodstable;
import org.come.until.GoodsListFromServerUntil;
import org.come.until.MessagrFlagUntil;

public class RefinersMouslisten implements MouseListener {
    private RefinersJpanel jpanel;
    private RefiningEquiJpanel Ejpanel;
    private RefiningEquiJpanel2 Ejpanel2;
    private DianJpanel Ejpanel1;
    private int path;

    public RefinersMouslisten(RefinersJpanel jpanel, int path) {
        this.jpanel = jpanel;
        this.path = path;
    }

    public RefinersMouslisten(RefiningEquiJpanel jpanel, int path) {
        this.Ejpanel = jpanel;
        this.path = path;
    }
    public RefinersMouslisten(RefiningEquiJpanel2 jpanel, int path) {
        this.Ejpanel2 = jpanel;
        this.path = path;
    }
    @Override
    public void mouseClicked(MouseEvent e) {
    }

    @Override
    public void mousePressed(MouseEvent e) {
        Goodstable goodstable = null;
        if (this.path < 24) {
            goodstable = GoodsListFromServerUntil.Getgood(this.path);
        } else if (this.jpanel != null) {
            goodstable = this.jpanel.goods[this.path - 24];
        } else if (this.Ejpanel != null) {
            goodstable = this.Ejpanel.goods[this.path - 24];
        }
       else if (this.Ejpanel2 != null) {
            goodstable = this.Ejpanel2.goods[this.path - 24];
        }

        if (goodstable != null) {
            if (this.jpanel != null) {
                this.jpanel.ClickGood(goodstable, this.path);
            } else if (this.Ejpanel != null) {
                this.Ejpanel.ClickGood(goodstable, this.path);
            }
            if (this.Ejpanel2 != null) {
                this.Ejpanel2.ClickGood(goodstable, this.path);
            }
        }

    }
    public RefinersMouslisten(DianJpanel jpanel, int path) {
        super();
        this.Ejpanel1 = jpanel;
        this.path = path;
    }

    @Override
    public void mouseReleased(MouseEvent e) {
    }

    @Override
    public void mouseEntered(MouseEvent e) {
        if (MessagrFlagUntil.ImgFlagImg.equals(MessagrFlagUntil.MOUSE1)) {
            MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE12);
        }
        Goodstable goodstable = null;
        if (this.path < 24) {
            goodstable = GoodsListFromServerUntil.Getgood(this.path);
        } else if (this.jpanel != null) {
            goodstable = this.jpanel.goods[this.path - 24];
        } else if (this.Ejpanel != null) {
            goodstable = this.Ejpanel.goods[this.path - 24];
        }
       else if (this.Ejpanel2 != null) {
            goodstable = this.Ejpanel2.goods[this.path - 24];
        }

        if (goodstable != null) {
            ZhuFrame.getZhuJpanel().creatgoodtext(goodstable);
        }

    }

    @Override
    public void mouseExited(MouseEvent e) {
        if (MessagrFlagUntil.ImgFlagImg.equals(MessagrFlagUntil.MOUSE12)) {
            MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
        }
        ZhuFrame.getZhuJpanel().cleargoodtext();
    }
}
